<template>
	<view class="meractdetail">
		<view class="list">
			<view class="item">
				<view class="item_title">审核状态</view>
				<view class="item_text">{{shoprateinfoData.status}}</view>
			</view>
			<view class="item" v-if="shoprateinfoData.reason">
				<view class="item_title">失败原因</view>
				<view class="item_text">{{shoprateinfoData.reason}}</view>
			</view>
			<view class="item">
				<view class="item_title">商户名称</view>
				<view class="item_text">{{shoprateinfoData.shop_name}}</view>
			</view>
			<view class="item">
				<view class="item_title">商户UID</view>
				<view class="item_text">{{shoprateinfoData.uid}}</view>
			</view>
			<view class="item">
				<view class="item_title">门店ID</view>
				<view class="item_text">{{shoprateinfoData.suid}}</view>
			</view>
			<view class="item">
				<view class="item_title">基础支付费率<br>(万分数)</view>
				<view class="item_text">
					<view class="item_text">{{shoprateinfoData.rate}}</view>
				</view>
				<!-- <view class="item_edit">
					<image @click="editSw(0)" v-show="!baseObj.isedit" src="../../static/img/ic_edit.png"></image>
					<view class="item_edit_text" v-show="baseObj.isedit">
						<text>完成</text>
						<text @click="editSw(0)">取消</text>
					</view>
				</view> -->
			</view>
			<!-- <view class="item">
				<view class="item_title">外卖订单费率<br>(万分数)</view>
				<view class="item_text">
					<input type="text" :value="orderObj.realVal" :disabled="!orderObj.isedit" :focus="orderObj.isedit" />
				</view>
				<view class="item_edit">
					<image @click="editSw(1)" v-show="!orderObj.isedit" src="../../static/img/ic_edit.png"></image>
					<view class="item_edit_text" v-show="orderObj.isedit">
						<text>完成</text>
						<text @click="editSw(1)">取消</text>
					</view>
				</view>
			</view> -->
		</view>
		<view class="list">
			<view class="item">
				<view class="item_title">提交人</view>
				<view class="item_text">{{shoprateinfoData.realname}}</view>
			</view>
			<view class="item">
				<view class="item_title">提交时间</view>
				<view class="item_text">{{shoprateinfoData.submit_time}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { shoprateinfo } from '../../api/index.js'
	export default {
		data() {
			return {
				baseObj:{
					isedit:false,
					realVal:0,
					inventVal:''
				},
				orderObj:{
					isedit:false,
					realVal:0,
					inventVal:''
				},
				shoprateinfoData:""
			}
		},
		onLoad:function(data){
			this.getShoprateinfo(data.id)
		},
		methods: {
			editSw:function(type){
				let that = this;
				if(type == 0){
					that.baseObj.isedit = !that.baseObj.isedit;
				}else if(type == 1){
					that.orderObj.isedit = !that.orderObj.isedit;
				}
			},
			getShoprateinfo:function(id){
				let that = this;
				shoprateinfo({
					id:id
				}).then((res) => {
					console.log(res);
					if(res.code == 0){
						that.shoprateinfoData = res.data
					}
				}).catch((e) => {
					console.log(e);
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.meractdetail{
		height: 100%;
		background-color: #F5F5F5;
		font-size: $uni-font-size-base;
		border-top: 1rpx solid $uni-solid-color;
		.list{
			background-color: #FFFFFF;
			padding: 0 30rpx;
			margin-bottom: 30rpx;
			.item{
				display: flex;
				align-items: center;
				padding: 30rpx 0;
				border-bottom: 1rpx solid $uni-solid-color;
				position: relative;
				.item_title{
					color: #666666;
					width: 30%;
				}
				.item_text{
					width: 50%;
				}
				.item_edit{
					text-align: right;
					width: 20%;
					image{
						width: 40rpx;
						height: 40rpx;
					}
					.item_edit_text{
						text{
							margin-left: 10rpx;
						}
					}
				}
			}
		}
	}
</style>
